results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_cl_2.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_cl_2.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_cl_2.pdf',
'./graphs/china/results_cluster_cl_2.pdf',
'./graphs/china/ct_cluster_cl_2.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_cl_5.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1, cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 5 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_cl_5.pdf', width = 7, height = 3)
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_cl_5.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_cl_5.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_cl_5.pdf',
'./graphs/china/results_cluster_cl_5.pdf',
'./graphs/china/ct_cluster_cl_5.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster.csv") %>% filter(year > 2003)
data_china <- data_china %>% mutate(sum_invest = ifelse(is.na(sum_invest), 0, sum_invest))
data_china %>% distinct(cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 5 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_invest.pdf', width = 7, height = 3)
#### Reproduces Figure A.16 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2 + sum_invest,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_invest.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_invest.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_invest.pdf',
'./graphs/china/results_cluster_invest.pdf',
'./graphs/china/ct_cluster_invest.pdf'))
knitr::opts_chunk$set(echo = F, warning = F, comment = F, message = F, fig.show = 'hide', fig.ncol = 1, fig.align = "center")
library(tidyverse)
library(giscoR)
library(zoo)
library(gsynth)
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_co_0025.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1, cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 3 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_co_0025.pdf', width = 7, height = 3)
#### Reproduces Figure A.11 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_co_0025.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_co_0025.pdf', width = 7, height = 3)
# Save plots
knitr::include_graphics(c('./graphs/china/pre_treatment_co_0025.pdf',
'./graphs/china/results_cluster_co_0025.pdf',
'./graphs/china/ct_cluster_co_0025.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_co_01.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1, cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 4 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_co_01.pdf', width = 7, height = 3)
#### Reproduces Figure A.10 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_co_01.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_co_01.pdf', width = 7, height = 3)
# Save plots
knitr::include_graphics(c('./graphs/china/pre_treatment_co_01.pdf',
'./graphs/china/results_cluster_co_01.pdf',
'./graphs/china/ct_cluster_co_01.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_th_01.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1, cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 1 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_th_01.pdf', width = 7, height = 3)
#### Reproduces Figure A.12 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) ,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_th_01.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_th_01.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_th_01.pdf',
'./graphs/china/results_cluster_th_01.pdf',
'./graphs/china/ct_cluster_th_01.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_th_05.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1,cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 3 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_th_05.pdf', width = 7, height = 3)
#### Reproduces Figure A.13 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_th_05.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_th_05.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_th_05.pdf',
'./graphs/china/results_cluster_th_05.pdf',
'./graphs/china/ct_cluster_th_05.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_cl_2.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1, cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 5 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_cl_2.pdf', width = 7, height = 3)
#### Reproduces Figure A.14 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_cl_2.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_cl_2.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_cl_2.pdf',
'./graphs/china/results_cluster_cl_2.pdf',
'./graphs/china/ct_cluster_cl_2.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster_cl_5.csv") %>% filter(year > 2003)
data_china %>% distinct(ctry1, cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 5 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_cl_5.pdf', width = 7, height = 3)
#### Reproduces Figure A.15 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_cl_5.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_cl_5.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_cl_5.pdf',
'./graphs/china/results_cluster_cl_5.pdf',
'./graphs/china/ct_cluster_cl_5.pdf'))
data_china <- read_csv2("C:/Users/CSteinert/OneDrive - Universität St.Gallen/Dokumente/unga_bri_project/replication_files/data/data/final_data/china_data_with_cluster.csv") %>% filter(year > 2003)
data_china <- data_china %>% mutate(sum_invest = ifelse(is.na(sum_invest), 0, sum_invest))
data_china %>% distinct(cluster) %>% arrange(cluster)
df <- data_china %>% drop_na(IdealPointDistance)
df <- df %>% drop_na(polity2_dist, gdp_cap_dist)
df <- df %>% group_by(ctry1) %>% mutate(n = n())
df_sub <- df %>% filter(cluster == 5 & ctry1 != 'Canada')
table <- df_sub %>% select(ctry1) %>% distinct()
knitr::kable(table)
# Pre-treatment trends
ggplot(df_sub %>% filter(year %in% c(2004:2013)), aes(year, IdealPointDistance, color = ctry1)) +
geom_line() +
theme_minimal() +
theme(legend.position = 'none') +
labs(x = 'Year')
#ggsave('./graphs/china/pre_treatment_invest.pdf', width = 7, height = 3)
#### Reproduces Figure A.16 ####
m1 <- gsynth(IdealPointDistance ~ treated + ctry1_fariss + log(ctry1_gdp_cap) + ctry1_polity2 + sum_invest,
data = df_sub,
index = c("ctry1", "year"),
se = T,
force = 'time',
# CV = TRUE,
r = c(0, 5),
inference = "parametric", nboots = 1000,
parallel = FALSE)
results <- as.tibble(m1$est.att) %>%
mutate(n = row_number()) %>%
mutate(ci_90_low = ATT - 1.645 * S.E.,
ci_90_high = ATT + 1.645 * S.E.,
n = n-10.5)
ggplot(results, aes(n, ATT)) +
geom_hline(yintercept = 0, lty = 2, color = "gray60") +
geom_vline(xintercept = 0, lty  =2 ) +
geom_linerange(data = results,
aes(x = n, y = ATT, ymin = ci_90_low, ymax = ci_90_high),
size = 0.75,
color = 'gray80',
position = position_dodge(width = 1/2)) +
geom_point(position = position_dodge(width = 1/2), size = 2) +
labs(y = "ATT",
x = "Time") +
theme_minimal() +
theme(axis.title.y=element_blank(), legend.position = "none")
#ggsave('./graphs/china/results_cluster_invest.pdf', width = 7, height = 3)
plot(m1, type = 'ct') +
theme_minimal() +
theme(legend.position = 'bottom') +
labs(title = "",
x = 'Treatment Time')
#ggsave('./graphs/china/ct_cluster_invest.pdf', width = 7, height = 3)
knitr::include_graphics(c('./graphs/china/pre_treatment_invest.pdf',
'./graphs/china/results_cluster_invest.pdf',
'./graphs/china/ct_cluster_invest.pdf'))
